import java.util.Comparator;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.function.Consumer;

@FunctionalInterface
interface NoParaNoRet{
    void method();
}
@FunctionalInterface
interface OneParaNoRet{
    void method(int a);
}
@FunctionalInterface
interface MoreParaNoRet{
    void method(int a, int b);
}
@FunctionalInterface
interface NoParaRet{
    int method();
}
@FunctionalInterface
interface OneParaRet{
    int method(int a);
}
@FunctionalInterface
interface MoreParaRet{
    int method(int a, int b);
}


public class Test {
    public static void main(String[] args) {
        NoParaNoRet i1 = new NoParaNoRet() {
            @Override
            public void method() {
                System.out.println("NoParaNoRet");
            }
        };
        NoParaNoRet i11 = ()->{
            System.out.println("Lambda NoParaNoRet");
        };
        i1.method();
        i11.method();
        OneParaNoRet i2 = (a)->{
            System.out.println(a);
        };
        OneParaNoRet i22 = a-> System.out.println(a);
        i2.method(2);
        i22.method(22);

        PriorityQueue<Integer> heap = new PriorityQueue<>((o1,o2)->o2.compareTo(o1));
        heap.add(3);
        heap.add(2);
        heap.add(3);
        heap.add(1);
        heap.add(2);
        heap.add(1);
        heap.add(3);
        heap.forEach(new Consumer<Integer>(){
            @Override
            public void accept(Integer integer) {
                System.out.println(integer);
            }
        });
    }

}
